import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:new_yuqib_app/yqbConfig/color_theme.dart';
import 'package:new_yuqib_app/yqbConfig/file_path.dart';
import 'package:new_yuqib_app/yqbConfig/yqb_app.dart';
import 'package:new_yuqib_app/yqbView/WebView/view.dart';

class GyView extends StatelessWidget {
  const GyView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: const CupertinoNavigationBarBackButton(color: Colors.black),
        title: const Text('关于我们'),
        centerTitle: true,
      ),
      body: Column(
        children: [
          const SizedBox(height: 61),
          Container(
            width: 64,
            height: 64,
            decoration: BoxDecoration(
              image: const DecorationImage(
                image: AssetImage(FilePath.iconPath),
                fit: BoxFit.fill,
              ),
              borderRadius: BorderRadius.circular(12),
            ),
          ),
          const SizedBox(height: 16),
          Text(
            "逾期帮V${YqbApp.packageInfo.version}",
            style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: ColorTheme.primaryTextColor2),
          ),
          const SizedBox(height: 6),
          const Text(
            "渝ICP备2023015868号-4A",
            style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: ColorTheme.primaryTextColor2),
          ),
          const SizedBox(height: 26),
          Container(
            margin: const EdgeInsets.symmetric(horizontal: 12),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(8),
            ),
            child: Column(
              children: [
                ListTile(
                  title: const Text("用户协议"),
                  titleTextStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: ColorTheme.primaryTextColor),
                  trailing: Image.asset(FilePath.iconRightPath, width: 18),
                  onTap: (){
                    Get.to(const WebView(typeId: 0));
                  },
                ),
                const Padding(
                  padding: EdgeInsets.symmetric(horizontal: 16),
                  child: Divider(color: ColorTheme.borderColor),
                ),
                ListTile(
                  title: const Text("隐私政策"),
                  titleTextStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: ColorTheme.primaryTextColor),
                  trailing: Image.asset(FilePath.iconRightPath, width: 18),
                  onTap: (){
                    Get.to(const WebView(typeId: 1));
                  },
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
